package com.party.core.dao.read.crowdfund;

import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.crowdfund.MemberWithdrawalFund;
import com.party.core.model.wallet.CrowdfundEventWithdrawalsOutput;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 会员提现资金数据写入
 * Created by hqh
 *
 * @date 2018/10/10 0025
 * @time 16:22
 */

@Repository
public interface MemberWithdrawalFundReadDao extends BaseReadDao<MemberWithdrawalFund> {

    /**
     * 通过订单的支付时间查询所有机构的众筹成功的可提现金额
     *
     * @param queryDate 查询时间
     * @return
     */

    List<MemberWithdrawalFund> getMemberEventWithdrawalFund(@Param("queryDate")String queryDate, @Param("params")Map<String,Object> params);

    /**
     * 通过订单的支付时间查询所有机构的众筹成功的人数
     *
     * @param eventId 主题id
     * @param queryDate 查询时间
     * @return
     */
    Integer countBySuccessDate(@Param("eventId") String eventId, @Param("queryDate")String queryDate,@Param("sign")Integer sign,@Param("params")Map<String,Object> params);


    /**
     * 通过MemberWithdrawalFund实体查询
     *
     * @param memberWithdrawalFund
     * @return
     */
    MemberWithdrawalFund findByMemberWithdrawalFund(MemberWithdrawalFund memberWithdrawalFund);

    /**
     * 通过MemberWithdrawalFund实体查询总可提现金额
     *
     * @param memberWithdrawalFund
     * @return
     */
    Double getMemberCanWithdrawAmount(MemberWithdrawalFund memberWithdrawalFund);

    /**
     * 通过memberId实体查询机构下的可提现主题
     *
     * @param memberId
     * @return
     */
    List<CrowdfundEventWithdrawalsOutput> getMemberEventWithdrawalList(@Param("memberId")String memberId,Page page);

}
